﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Ebada.Platform.Model;
using Ebada.UI.Base;
using Ebada.Client;
using Ebada.Core;
using Ebada.Client.Platform;
namespace Ebada.Modules.Vehicle
{
    /// <summary>
    /// 违章记录编辑
    /// </summary>
    public partial class frmCardRechargeView : FormBase, IPopupFormEdit 
    {
        public frmCardRechargeView()
        {
            
            InitializeComponent();
            initImageList();
        }
        #region IPopupFormEdit Members
        private VehicleAccident rowData = null;

        public object RowData
        {
            get
            {
                return rowData;
            }
            set
            {
                if (value == null) return;
                if (rowData == null)
                {
                    this.rowData = value as VehicleAccident;

                }
                else
                {
                    ConvertHelper.CopyTo<VehicleAccident>(value as VehicleAccident, rowData);

                }
            }
        }

        #endregion

        private void initImageList()
        {
            ImageList imagelist = new ImageList();
            imagelist.ImageStream = (Ebada.Client.Resource.UCGridToolbar.UCGridToolbarImageList);
            barManager1.Images = imagelist;
        }
        public void LoadData()
        {
            IList<Empolyees> list2 = MainHelper.GetSqlMap<Empolyees>().GetListByWhere<Empolyees>(" where 1=1 order by Empolyee_ID");
            repositoryItemLookUpEdit1.DataSource = list2;
            IList<RechargeHis> list = MainHelper.GetSqlMap<RechargeHis>().GetListByWhere<RechargeHis>(" where 1=1 order by GasCard_Num,RechargeDate");
            gridControl1.DataSource = list;
        }

        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.Close();
        }
    }
}
